exception Name_clash1
;;

let name_clash1_msg () =
  prerr_newline ();
  prerr_string "Name clash among variables in main program.";
  prerr_newline ();
  prerr_newline ()
;;

exception Name_clash2
;;

let name_clash2_msg () =
  prerr_newline ();
  prerr_string "Name clash among functions in main program.";
  prerr_newline ();
  prerr_newline ()
;;

exception Name_clash3 of string
;;

let name_clash3_msg s =
  prerr_newline ();
  prerr_string ("Name clash among local identifiers in function "^s^".");
  prerr_newline ();
  prerr_newline ()
;;

exception Name_clash4
;;

let name_clash4_msg () =
  prerr_newline ();
  prerr_string "Name clash among records in main program.";
  prerr_newline ();
  prerr_newline ()
;;

exception Bad_ident
;;

let bad_ident_msg line =
  prerr_newline ();
  prerr_string ("Illegal identifier near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()
;;

exception Unknown_ident of string
;;

let unknown_ident_msg id line =
  prerr_newline ();
  prerr_string ("Unknown identifier " ^ id ^ " near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()
;;

exception Unknown_member of string
;;

let unknown_member_msg name line =
  prerr_newline ();
  prerr_string ("Unknown record field \"" ^ name ^ "\" accessed near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()
;;

exception SType_error
;;

let stype_error_msg line =
  prerr_newline ();
  prerr_string ("Type mismatch in statement near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()
;;

exception UnknownType_error
;;

let unknowntype_error_msg line =
  prerr_newline ();
  prerr_string ("Unknown type in statement near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()
;;

exception EType_error 
;;

let etype_error_msg line =
  prerr_newline ();
  prerr_string ("Type mismatch in expression near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()
;;

exception Sort_error of string
;;

let sort_error_msg s =
  prerr_newline ();
  prerr_string ("Function "^s^" is wrongly typed");
  prerr_newline ();
  prerr_newline ()
;;

exception Void_declared_error of string
;;

let void_declared_msg var line =
  prerr_newline ();
  prerr_string ("Variable "^var^" declared as void near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()

let syntax_error_msg line =
  prerr_newline ();
  prerr_string ("Syntax error near line "^(string_of_int line)^".");
  prerr_newline ();
  prerr_newline ()
;;

exception Wrong_eof

let wrong_eof_msg line =
  prerr_newline ();
  prerr_string ("End of file inside comment");
  prerr_newline ();
  prerr_newline ()
;;
